package com.pingba.util;

import com.pingba.entity.msg.MsgReply;
import com.pingba.entity.msg.MsgSend;
import com.pingba.util.helper.DateHelper;
import com.pingba.util.helper.JsonHelp;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created by Administrator on 2015/11/2 0002.
 */
public class Test {

    public static void main(String args[]) {
//        testTime();
//        System.exit(0);

//        list2Json();
        String json = "[1,2]";
        json2List(json);
    }

    public static void testTime() {
        Date d = new Date(1449151168908L);
        System.out.println(d);
    }

    public static void list2Json() {
        List<Long> idList = new ArrayList<Long>();
        idList.add(1L);
        idList.add(2L);
        System.out.println(JsonHelp.jsonFromObject(idList));
    }

    public static void json2List(String jsonStr) {
        System.out.println("input is: " + jsonStr);
        ArrayList<Double> objList = JsonHelp.objectFromJson(jsonStr, (new ArrayList<String>()).getClass());
        for (Double l: objList) {
            System.out.println(l);
        }
        System.out.println("11");
    }
}